import request from '@/utils/request'

export function getImageOrTextIdentifyRes(data) {
  return request({
    url: '/ai/character/recognition',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8'
    },
    data
  })
}


export function getImageDenoiseRes(data) {
  return request({
    url: '/ai/image/noise/reduction',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8'
    },
    data
  })
}


// 短语音识别
export function getVliceIdentifyRes(data) {
  return request({
    url: '/ai/voice/recognition',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8'
    },
    data
  })
}


// 音频文件转写
export function getAudioFileTranscriptionRes(data: any) {
  return request({
    url: '/ai/voice/transcription',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8'
    },
    data
  })
}

export function getAudionTransQueryRes(data: any) {
  return request({
    url: '/ai/voice/transcription/query',
    method: 'POST',
    data
  })
}

//短文本转语音
export function getTextToVoiceRes(data: any) {
  return request({
    url: '/ai/short/text/synthetic',
    method: 'POST',
    responseType: 'arraybuffer',
    data
  })
}

//长文本转语音创建任务
export function getLongTextToVoiceRes(data: any) {
  return request({
    url: '/ai/long/text/synthetic/create',
    method: 'POST',
    data
  })
}

//长文本转语音查询任务
export function getLongTextToVoiceQueryRes(data: any) {
  return request({
    url: '/ai/long/text/synthetic/query',
    method: 'POST',
    responseType: 'arraybuffer',
    data,
  })
}